#include "Log.hpp"
#include"ThreadPool.hpp"
#include<memory>
#include"task.hpp"
using namespace LogMoudle;
using namespace ThreadPoolMoudle;
int main()
{
    Enable_Console_Log_Strategy();

    // ThreadPool<int> *tp = new ThreadPool<int>();

    // tp->Start();
    int count = 10;
    while (count)
    {
        sleep(1);
        ThreadPool<task_t>::GetInstance()->Equeue(Download);
        count--;
    }

    ThreadPool<task_t>::GetInstance()->Stop();
    ThreadPool<task_t>::GetInstance()->Join();
    // tp->Equeue(t);

    // Enable_Console_Log_Strategy();
    // LOG(loglevel::DEBUG) << "hello world" << 3.141;
    // LOG(loglevel::DEBUG) << "hello world" << 3.142;

    // Enable_File_Log_Strategy();
    // LOG(loglevel::DEBUG) << "hello world" << 3.143;
    // LOG(loglevel::DEBUG) << "hello world" << 3.144;



    // std::unique_ptr<LogManage> strategy = std::make_unique<ConsoleLogStrategy>(); // C++14
    // std::unique_ptr<LogManage> strategy = std::make_unique<FileLogStrategy>(); // C++14
    // strategy->Synclog("hello log!");
    // logger(loglevel::DEBUG, "main.cc", 10) << "hello world," << 3.14 << " " << 8899 << "aaaa";
    // logger(loglevel::DEBUG, "main.cc", 10) << "hello world";
    // logger(loglevel::DEBUG, "main.cc", 10) << "hello world";
    // logger(loglevel::DEBUG, "main.cc", 10) << "hello world";
    // logger(loglevel::DEBUG, "main.cc", 10) << "hello world";
    // logger(loglevel::DEBUG, "main.cc", 10) << "hello world";
    // logger(loglevel::DEBUG, "main.cc", 10) << "hello world";
    return 0;
}